<?php if (!defined('MAX_ON')){echo "<h1>ACCESS DENIED</h1>You cannot access this file directly.";exit();} ?>
<?php if ($template_hook=='start'){ ?>
<?php }elseif ($template_hook=='1'){ ?>

		<!-- registration form -->

		<table class="forum-board-forum-register" cellpadding="0" cellspacing="0" align="center">
			<tr><td class="forum-topic-subject"><?php echo $lang['register_title']; ?></td></tr>
			<tr><td class="forum-index-stats-sub"> </td></tr>
		</table>
		<form name="register" id="register" action="<?php echo max_link("index.php?page=register", "register"); ?>" onsubmit="return validate_info(); return check_passwords" method="post">
<table class="forum-index-register" cellpadding="0" cellspacing="0" align="center">
<tr>
	<td class="panelsurround" align="center">
	<div class="panel">

		<div style="width:640px" align="<?php echo $lang['header_right']; ?>">

			<div class="smallfont" style="margin-bottom:3px">
				<?php echo $lang['register_info']; ?>
			</div>
			<div class="smallfont" style="margin-bottom:3px">
				<strong><?php echo $lang['register_username']; ?></strong>:<br />
				<input class="bginputs" type="text" id="name_fb" name="name"
value="<?php 
if($_POST['name']){
	echo $_POST['name'];
}elseif(isset($_SESSION['session_name']))
{
	echo $_SESSION['session_name'];
}else{
	echo $name;
}
?>" style="width: 40%;" maxlength="<?php echo $username_length; ?>" />
<?php if ($_GET['error']=='2'){ ?>
						<span class="register-warning"> <?php echo $lang['register_taken']; ?></span>
<?php }elseif ($_GET['error']=='1'){ ?>
						<span class="register-warning"> <?php echo $lang['register_required']; ?></span>
<?php } elseif ($_GET['error'] == 7){ ?>
						<span class="register-warning"> <?php echo $lang['register_length']; ?></span>
<?php } ?>
			</div>

			<fieldset class="fieldset">
				<legend><?php echo $lang['register_password']; ?></legend>
				<table cellpadding="0" cellspacing="3" border="0" width="400">
				<tr>
					<td colspan="2"><?php echo $lang['register_password_des']; ?></td>
				</tr>
				<tr>
					<td>
						<div class="marg_pin"><?php echo $lang['register_password']; ?> :</div>
						<input type="password" class="bginputs" id="pass" name="password" size="25" maxlength="50" value="" />
					</td>
					<td>
						<div class="marg_pin"><?php echo $lang['register_password_repeat']; ?> :</div>
						<input type="password" class="bginputs" id="check_pass" name="check_pass" size="25" maxlength="50" value="" />
					</td>
				</tr>
				<tr>
					<td>
<?php if ($_GET['error']=='3'){ ?>
						<span style="color: red;"> <?php echo $lang['register_required']; ?></span>
<?php } ?>
					</td>
				</tr>
				</table>
			</fieldset>

			<fieldset class="fieldset">
				<legend><?php echo $lang['register_email']; ?></legend>
				<table cellpadding="0" cellspacing="3" border="0" width="400">
				<tr>
					<td colspan="2"><?php echo $lang['register_email_des']; ?></td>
				</tr>
				<tr>

					<td>
						<div class="marg_pin"><?php echo $lang['register_email']; ?> :</div>
						<input type="email" class="bginputs" id="email_fb" name="email"
value="<?php 
if($_POST['email']){
	echo $_POST['email'];
}elseif (isset($_SESSION['session_email']))
{
	echo $_SESSION['session_email'];
	unset ($_SESSION['session_email']);
}else{
	echo $email;
} ?>" />
					</td>
					<td>
						<div class="marg_pin"><?php echo $lang['register_email_conf']; ?></div>
						<input type="email" class="bginputs" id="email_fb" name="emailconfirm"
value="<?php 
if($_POST['email']){
	echo $_POST['email'];
}elseif (isset($_SESSION['session_emailconf']))
{
	echo $_SESSION['session_emailconf'];
	unset ($_SESSION['session_emailconf']);
}else{
	echo $email;
} ?>" />
					</td>

				</tr>
				<tr>
					<td>
<?php if ($_GET['error']=='4'){ ?>
						<span style="color: red;"> <?php echo $lang['register_required']; ?></span>
<?php }elseif ($_GET['error']=='6'){ ?>
						<span style="color: red;"> <?php echo $lang['register_email_taken']; ?></span>
<?php } ?>
					</td>
				</tr>
				
				</table>
			</fieldset>

			<fieldset class="fieldset">
	<legend><?php echo $lang['register_security']; ?></legend>
	<table cellpadding="0" cellspacing="3"  border="0" width="100%">
	<tr>
<?php }elseif ($template_hook=='captcha'){ ?>
		<td width="100%" valign="top">
			<?php echo $lang['register_security_des']; ?><br /><br />
			<input id="security_code" class="bginputs" name="security_code" maxlength="6" />
		</td>
		<td valign="bottom" align="center">
						<img class="captcha_img" src="<?php echo "$max_domain"; ?>/libs/php/captcha/CaptchaSecurityImages.php" alt="captcha" />
<?php }elseif ($template_hook=='recaptcha'){ ?>
		<td valign="bottom" align="center">
						<?php echo recaptcha_get_html($recaptcha_public, $error); ?>
<?php }elseif ($template_hook=='5'){ ?>
<?php if ($_GET['error']=='5'){ ?>
						<span style="color: red;"> <?php echo $lang['register_security_wrong']; ?></span>
<?php } ?>
		</td>
	</tr>
	</table>
</fieldset>

		</div>
	</div>
	</td>

</tr>
<tr>
	<td class="panelsurround" align="center">

	<div class="panel">
		<div style="width:640px" align="<?php echo $lang['header_right']; ?>">
			<fieldset class="fieldset">
	<legend><label for="sel_timezoneoffset"><?php echo $lang['register_time']; ?></label></legend>
	<table cellpadding="0" cellspacing="3" border="0" width="100%">
	<tr>

		<td><?php echo $lang['register_time_des']; ?></td>
	</tr>
	<tr>
		<td>
			<span style="float:<?php echo $lang['header_left']; ?>">
							<select name="time_offset">
								<option value="<?php echo "$timezone"; ?>" selected="selected"><?php echo $lang_user['timezone_current']; ?></option>
<?php }elseif ($template_hook=="time"){ ?>
								<option value="<?php echo "$start_time_value" ?>"><?php echo "$formatted_start_time" ?></option>
<?php }elseif ($template_hook=="aftertime"){ ?>
							</select>
			</span>
			<label for="sel_timezoneoffset"><?php echo $lang['register_time']; ?> :</label>
		</td>

	</tr>
	<tr>
		<td><?php echo $lang['register_dst_des']; ?></td>
	</tr>
	<tr>
		<td>
			<span style="float:<?php echo $lang['header_left']; ?>">
			<select name="dst" id="sel_dst">

				<option value="2" ><?php echo $lang['register_dst_check1']; ?></option>
				<option value="1" ><?php echo $lang['register_dst_check2']; ?></option>
				<option value="0" ><?php echo $lang['register_dst_check3']; ?></option>
			</select>
			</span>
			<label for="sel_dst"><?php echo $lang['register_dst']; ?> :</label>
		</td>

	</tr>
	</table>
</fieldset>

			<fieldset class="fieldset">
				<legend><?php echo $lang['register_recerv_email']; ?></legend>
				<table cellpadding="0" cellspacing="3" border="0" width="100%">
				<tr>
					<td>
						<?php echo $lang['register_recerv_des']; ?>
					</td>
				</tr>
				<tr>
					<td><label for="cb_adminemail"><input type="checkbox" name="options[adminemail]" value="1" id="remember" checked="checked" /><?php echo $lang['register_recerv_admin']; ?></label></td>
				</tr>
				</table>

			</fieldset>


			

		</div>
	</div>

	<div style="margin-top:6px">
		<input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" />
		<input type="reset" class="img-submit" value="<?php echo $lang['button_reset']; ?>" />
	</div>
					<input type="hidden" value="1" name="form" />
<?php if ($guest_register=='1'){ ?>
					<input type="hidden" name="token_id" value="<?php echo "$token_id"; ?>" />
					<input type="hidden" name="<?php echo "$token_name"; ?>" value="<?php echo "$token"; ?>" />
<?php } ?>
	</td>
</tr>
</table>
</form>
		<table class="forum-index-forum-register" cellpadding="0" cellspacing="0" align="center">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
<?php }elseif ($template_hook=='2'){ ?>
		<!-- confirm registration -->
		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forum-topic-subject"> </td>
			</tr>
		</table>
		<table class="forum-index" cellpadding="0" cellspacing="0">
			<tr>
				<td class="error-header" style="width:100%;">
					<?php echo $lang['register_thanks']; ?>
				</td>
			</tr>
			<tr>
				<td class="forum-jump-content" style="width:100%;">
					<?php if ($Settings['email_validation'] == 1){ ?>
						<?php echo $lang['register_email_verify']; ?>
					<?php } else { ?>
						<?php echo $lang['register_email_proceed']; ?>
					<?php } ?>
				</td>
			</tr>
		</table>
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
<?php }elseif ($template_hook=='3'){ ?>
		<!-- apostrophe error -->
		<?php echo $lang['register_apostrophe']; ?>
<?php }elseif ($template_hook=='4'){ ?>
		<!-- t's & c's -->
		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr><td class="forum-topic-subject"><?php echo $lang['register_title']; ?></td></tr>
			<tr><td class="forum-index-stats-sub"> </td></tr>
		</table>
		<table class="forum-index" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-stats-header" style="border-top: none;"><?php echo $lang['register_terms']; ?></td></tr>
			<tr><td class="forum-jump-content" style="border-top: none; border-bottom: none;">
				<form name="face_reg" id="face_reg" action="<?php echo max_link("index.php?page=register", "register"); ?>" onsubmit="return check_agreement('<?php echo $lang['register_terms_conditions_warn'] ?>')" method="post">
					<textarea class="terms" style="width: 98%; padding: 5px;" readonly name="disabled" rows="10" cols="98"><?php echo $lang['terms_conditions']; ?></textarea>
					<br /><br />
					<input type="checkbox" class="checkbox" name="agree" id="user_agree">
						<label for="agree"><strong><?php echo $lang['register_agree']; ?></strong></label>
					</input>
<?php if ($guest_register=='1'){ ?>
					<input type="hidden" name="token_id" value="<?php echo "$token_id"; ?>" />
					<input type="hidden" name="<?php echo "$token_name"; ?>" value="<?php echo "$token"; ?>" />
<?php } ?>
				</td></tr>
				<tr><td class="forum-index-stats-header" style="border-top: none; text-align: center;">
					<input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" />
				</td></tr>
			</form>
		</table>
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
<?php }elseif ($template_hook=='end'){ ?>
<?php } ?>
